<div id="displayListing">
	{title} {$listing.Title} {/title}
	{keywords} {$listing.Title} {/keywords}
	{description} {$listing.Title} {/description}
	{if $errors}
	    {foreach from=$errors key=error_code item=error_message}
			<p class="error">
				{if $error_code == 'UNDEFINED_LISTING_ID'} [[Listing ID is not defined]]
					{title} [[404 Not Found]] {/title}
				{elseif $error_code == 'WRONG_LISTING_ID_SPECIFIED'} [[There is no listing in the system with the specified ID]]
					{title} [[404 Not Found]] {/title}
				{elseif $error_code == 'LISTING_IS_NOT_ACTIVE'} [[This Job is no longer available]]
					{title} [[404 Not Found]] {/title}
				{elseif $error_code == 'NOT_OWNER'} [[You're not the owner of this posting]]
				{elseif $error_code == 'LISTING_IS_NOT_APPROVED'} [[Listing with specified ID is not approved by admin]]
					{title} [[404 Not Found]] {/title}
				{elseif $error_code == 'WRONG_DISPLAY_TEMPLATE'} [[Wrong template to display listing]]
				{/if}
			</p>
		{/foreach}
	{else}
		<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery-ui.js"></script>
		<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery.bgiframe.js"></script>
		<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery.form.js"></script>
		<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery.highlight.js"></script>

        {literal}
		<script type="text/javascript"><!--
		
		{/literal}
			var link = "{$GLOBALS.site_url}/flag-listing/";
			{literal}
            function popUpWindowIframe(url, widthWin, heightWin, title) {
                $("#messageBox").dialog( 'destroy' ).html('{/literal}<img style="vertical-align: middle" src="{$GLOBALS.site_url}/system/ext/jquery/progbar.gif" alt="[[Please, wait ...]]" /> [[Please, wait ...]]{literal}');
                $("#messageBox").dialog({
                    width: widthWin,
                    height: heightWin,
                    modal: true,
                    title: title
                }).dialog( 'open' );
                $("#messageBox").html('<iframe border="0" runat="server" height="450px" width="750px" frameborder="0" src="'+url+'"></iframe>');
                return false;
            }

			// send flagForm and show result
			function sendFlagForm() {
				$("#flagForm").ajaxSubmit({
					url : link, 
					success : function (data) {
						$("#messageBox").html(data);
					}
				});
				return false;
			}
			--></script>
		{/literal}

	<!-- START Listing Info Block -->
	<div id="listingInfo">
		{if $searchId != "" && $GLOBALS.user_page_uri != "/my-resume-details"}
			<span class="smallLinks">
				<a href="{$GLOBALS.site_url}{$search_uri}?action=search&amp;searchId={$searchId}&amp;page={$page}#listing_{$listing.id}">[[Back to Results]]</a> |
				<a href="{$GLOBALS.site_url}/search-resumes/?searchId={$searchId}">[[Modify Search]]</a>
			</span>
		{/if}

		<div id="listingsNavigation">
			{if $searchId != "" || $GLOBALS.user_page_uri == "/my-resume-details"}
				{if $prev_next_ids.prev}
					<span class="prevBtn"><a href="{$GLOBALS.site_url}/{if $GLOBALS.user_page_uri == "/my-resume-details"}my-resume-details{else}display-resume{/if}/{$prev_next_ids.prev}/?searchId={$searchId}&amp;page={$page}">[[Previous]]</a></span>
				{else}
					{if !$prev_next_ids.prev && !$prev_next_ids.next}{else}<span class="prevBtn"><a>[[Previous]]</a></span>{/if}
				{/if}
					
				{if $prev_next_ids.next}
					<span class="nextBtn"><a href="{$GLOBALS.site_url}/{if $GLOBALS.user_page_uri == "/my-resume-details"}my-resume-details{else}display-resume{/if}/{$prev_next_ids.next}/?searchId={$searchId}&amp;page={$page}">[[Next]]</a></span>
				{else}
					{if !$prev_next_ids.prev && !$prev_next_ids.next}{else}<span class="nextBtn"><a>[[Next]]</a></span>{/if}
				{/if}
			{/if}
		</div>
		<div class="clr"></div>
		<h2>{$listing.Title}</h2>

                <span id="smallListingInfo">
			<br/><strong>[[FormFieldCaptions!Resumes ID]]</strong>: [[$listing.id]]
			<br/><strong>[[FormFieldCaptions!Resumes Views]]</strong>: {$listing.views}
			<br/><strong>[[FormFieldCaptions!Location]]:</strong> {if $listing.City}{$listing.City}, {/if}[[$listing.State]], [[Property_Country!{$listing.Country}]]
			<br/><strong>[[FormFieldCaptions!Zip Code]]:</strong> {$listing.ZipCode}
			<br/><strong>[[FormFieldCaptions!Posted]]:</strong> [[$listing.activation_date]]
			<br/><strong>[[FormFieldCaptions!Job Type]]:</strong> {display property=JobType}
			<br/><strong>[[FormFieldCaptions!Job Category]]:</strong> {display property=JobCategory}
		</span>

		{capture name="middleFHContent"}
		<div id="userTools">
			<div id="userToolsItems">
				{if $GLOBALS.user_page_uri != "/my-resume-details"}
					{if $acl->isAllowed('save_resume')}
						<a onclick="popUpWindow('{$GLOBALS.site_url}/saved-ads/?listing_id={$listing.id}&displayForm=1&listing_type=resume', 350, 300, '[[Save this Resume]]', true, {if $GLOBALS.current_user.logged_in}true{else}false{/if}); return false;" href="{$GLOBALS.site_url}/saved_ads/?listing_id={$listing.id}">[[Save this Resume]]</a> |
					{elseif $acl->getPermissionParams('save_resume') == "message"}
						<a onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=save_resume', 300, 300, '[[Save this Resume]]'); return false;" href="{$GLOBALS.site_url}/saved_ads/?listing_id={$listing.id}">[[Save this Resume]]</a> |
					{/if}
					{if $GLOBALS.current_user.logged_in}
						{if $acl->isAllowed('save_resume')}
							<a href="{$GLOBALS.site_url}/saved_resumes">[[View Saved Resumes]]</a> |
						{elseif $acl->getPermissionParams('save_resume') == "message"}
							<a href="{$GLOBALS.site_url}/saved_resumes" onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=save_resume', 300, 300, '[[View Saved Resumes]]'); return false;">[[View Saved Resumes]]</a> |
						{/if}
					{else}
						<a onclick="popUpWindow('{$GLOBALS.site_url}/saved-listings/?listing_type_id=resume', 350, 300, '[[View Saved Resumes]]'); return false;" href="{$GLOBALS.site_url}/saved-listings/">[[View Saved Resumes]]</a> |
					{/if}
				{/if}
				{if $acl->isAllowed('flag_resume')}
					<a href="{$GLOBALS.site_url}/flag-listing/?listing_id={$listing.id}" onclick="popUpWindow('{$GLOBALS.site_url}/flag-listing/?listing_id={$listing.id}', 400, 350, '[[Flag Resume]]'); return false;" id="message_link">[[Flag This Resume]]</a> |
				{elseif $acl->getPermissionParams('flag_resume') == "message"}
					<a href="{$GLOBALS.site_url}/flag-listing/?listing_id={$listing.id}" onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=flag_resume', 300, 300, '[[Flag This Resume]]'); return false;" id="message_link">[[Flag This Resume]]</a> |
				{/if}
				<a target="_blank" href="{$GLOBALS.site_url}/print-listing/?listing_id={$listing.id}">[[Print This Ad]]</a> |
                {if $listing.latitude && $listing.longitude}
                    <a href="{$GLOBALS.site_url}/display-resume-map/?listing_id={$listing.id}&amp;searchId={$searchId}&amp;view=map" onclick="popUpWindowIframe('{$GLOBALS.site_url}/display-resume-map/?listing_id={$listing.id}&amp;searchId={$searchId}&amp;view=map&amp;lightbox=1', 800, 500, '[[Map]]'); return false;">[[View Map]]</a>
                {/if}
			</div>
			<span></span>
		</div>
		<div class="clr"><br/></div>

		<div class="ratingComments">
			{if $show_comments != 0 && $acl->isAllowed('add_resume_comments')}
				<a href="#comment_1">[[Comments]] (+{$listing.comments_num})</a>
			{elseif $acl->getPermissionParams('add_resume_comments') == "message"}
				<a href="#comment_1"  onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=add_resume_comments', 300, 300, '[[Comments]]'); return false;">[[Comments]] (+{$listing.comments_num})</a>
			{/if}

			{if $show_rates !=0 && $acl->isAllowed('add_resume_ratings')}
				<p>[[Rate This Resume]]: {include file="rating.tpl" listing=$listing}</p>
			{/if}
		</div>
		<div class="clr"><br/></div>
		{/capture}

		<div class="clr"></div>
		{* >>>>>>>>>>>>> FIELDS >>>>>>>>>>>>>>>> *}
		{include file="../builder/bf_displaylisting_fieldsholders.tpl"}
		{* <<<<<<<<<<<<< FIELDS <<<<<<<<<<<<<<<< *}
		<div class="clr"><br/></div>

		{* SOCIAL PLUGIN: FACEBOOK LIKE BUTTON *}
		{module name="social" function="facebook_like_button" listing=$listing type="Resume"}
		{* / SOCIAL PLUGIN: FACEBOOK LIKE BUTTON *}
		{if !$myListing && $GLOBALS.plugins.ShareThisPlugin.active == 1 && $GLOBALS.settings.display_on_resume_page == 1}
			{$GLOBALS.settings.header_code}
			{$GLOBALS.settings.code}
		{/if}
		<div class="clr"><br/></div>

		{if $acl->isAllowed('add_resume_comments')}
			{include file="listing_comments.tpl" listing=$listing }
			<div class="clr"><br/></div>
		{/if}
		{* >>>>> LISTING PREVIEW >>>>> *}
		{if $GLOBALS.user_page_uri == '/resume-preview'}
		<div class="preview-buttons">
			<form action="{$referer}" method="post">
				<input type="hidden" name="from-preview" value="1" />
				<input type="submit" name="edit_temp_listing" value="[[Edit:raw]]" class="button" id="listingPreview"/>
				<input type="submit" name="action_add" value="[[Post:raw]]" class="button" />
			</form>
		</div>
		{/if}
		{* <<<<< LISTING PREVIEW <<<<< *}
	</div>
	<!-- END Listing Info Block -->

	
	<!-- START User info block -->
	<div id="userInfo">
		<div id="informationBlock">
			<div id="blueBoxStart"></div>
			<div id="blueBoxBg">[[User Info]]</div>
			<div id="blueBoxEnd"></div>
		</div>
		<div id="informationBlockBg">
			{if $listing.anonymous != 1 || $applications.anonymous === 0 }
				{if $listing.user.Photo.file_url}
					<center><img src="{$listing.user.Photo.file_url}" alt="" /></center>
				{/if}
					<strong>{$listing.user.Name} {$listing.user.LastName}</strong>
					{if $allowViewContactInfo}<br />{$listing.user.Address}{/if}
					<br />{if $listing.user.City}{$listing.user.City}, {/if}<strong>[[$listing.user.State]]</strong> {if $listing.user.Country}([[$listing.user.Country]]){/if}
					<br /><br />
					{if $allowViewContactInfo}
					<br /><strong>[[FormFieldCaptions!Phone]]</strong>: {$listing.user.PhoneNumber}
					<br /><strong>[[FormFieldCaptions!Email]]</strong>: <a href="mailto:{$listing.user.email}">{$listing.user.email}</a><br/>
					{elseif $acl->getPermissionParams('view_resume_contact_info') == "message"}
						{module name="miscellaneous" function="access_denied" permission="view_resume_contact_info"}<br/>
					{/if}
				 
                    {if $allow_save_to_contacts}
                        <br/><a href="{$GLOBALS.site_url}/private-messages/contacts/?pm_action=save_contact&amp;user_id={$listing.user.id}" onclick="popUpWindow('{$GLOBALS.site_url}/private-messages/contacts/?pm_action=save_contact&amp;user_id={$listing.user.id}', 560, 100, '[[Save Contact]]', true, {if $GLOBALS.current_user.logged_in}true{else}false{/if}); return false;" class="linkArrow">[[Save Contact]]</a>
                    {/if}
                                       {if $listing.Resume.file_url != ""}
					<br /> 
					<a href="?filename={$listing.Resume.saved_file_name}" style="text-decoration:none;">
					<input type='button' class='button' value='Download Resume' style='text-transform:none; text-align:center'/> 
					</a>
				{/if}
					<br /><a href="{$GLOBALS.site_url}/search-results-resumes/?action=search&amp;username[equal]={$listing.user.id}" class="linkArrow">[[All resumes by this user]]</a>
					{if $acl->isAllowed('use_private_messages')}
						<br /><a href="{$GLOBALS.site_url}/private-messages/send/?to={$listing.user.id}" onclick="popUpWindow('{$GLOBALS.site_url}/private-messages/aj-send/?to={$listing.user.id}', 560, 400, '[[Send Private Message]]', true, {if $GLOBALS.current_user.logged_in}true{else}false{/if}); return false;" class="linkArrow">[[Send Private Message]]</a>
					{elseif $acl->getPermissionParams('use_private_messages') == "message"}
						<br /><a href="{$GLOBALS.site_url}/private-messages/send/?to={$listing.user.id}" onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=use_private_messages', 300, 300, '[[Send Private Message]]'); return false;"   class="linkArrow">[[Send Private Message]]</a>
					{/if}
				{* LINKEDIN: PROFILE WIDGET *}
				{module name="social" function="profile_widget" profileSID=$listing.user.id}
				{* end of : LINKEDIN: PROFILE WIDGET *}
			{else}
					<br /><strong>[[Anonymous User Info]]</strong>
					<br /> {if $listing.Resume.file_url != ""}
					<br /> 
					<a href="?filename={$listing.Resume.saved_file_name}" style="text-decoration:none;">
					<input type='button' class='button' value='Download Resume' style='text-transform:none; text-align:center'/> 
					</a>
				{/if}
					{if $acl->isAllowed('use_private_messages')}
						<br /><strong><a href="{$GLOBALS.site_url}/private-messages/send/?to={$listing.user.id}&amp;anonym=1" onclick="popUpWindow('{$GLOBALS.site_url}/private-messages/aj-send/?to={$listing.user.id}&anonym=1', 560, 400, '[[Send Private Message]]', true, {if $GLOBALS.current_user.logged_in}true{else}false{/if}); return false;"  class="linkArrow">[[Send Private Message]]</a></strong>
					{elseif $acl->getPermissionParams('use_private_messages') == "message"}
						<br /><strong><a href="{$GLOBALS.site_url}/private-messages/send/?to={$listing.user.id}&amp;anonym=1" onclick="popUpWindow('{$GLOBALS.site_url}/access-denied/?permission=use_private_messages', 300, 300, '[[Send Private Message]]'); return false;"   class="linkArrow">[[Send Private Message]]</a></strong>
					{/if}
			{/if}
			{foreach from=$video_fields item=field_id}
				{if $listing.$field_id.file_url != ""}
				<br/><center>{include file="video_player.tpl"}</center><br/>
				{/if}
			{/foreach}
			{if $listing.YouTube}
				<br /><center><strong>[[FormFieldCaptions!youtube]]:</strong></center>
				{display property=YouTube}
			{/if}
			{foreach from=$listing.pictures key=key item=picture name=picimages }
				<br/><a target="_blank" href ="{$picture.picture_url}"> <img src="{$picture.thumbnail_url}" border="0" title="{$picture.caption}" alt="{$picture.caption}" /> </a>
			{/foreach}
		</div>
	</div>
	<!-- END User info -->
	{/if}
</div>

<script>
{if $keywordsHighlight}
	$("#listingInfo").highlight("{$keywordsHighlight}");
{/if}
</script>